package com.googlecode.animator.view.timeline
{
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	import mx.core.BitmapAsset;
	
	public class Thumb extends SnapDraggableObject
	{
		[Embed(source="com/googlecode/assets/thumb.gif")]
		[Bindable]
		private var thumbImg:Class;
		
		public static const THUMB_UP:String = "thumbUp";
		public static const THUMB_MOVE:String = "thumbMove";
		public static const NAME:String = "thumb";
		
		public function Thumb(w:uint, h:uint)
		{
			super(w);
			
			name = NAME;
			
			//Make thumb
			var icon:BitmapAsset = new thumbImg();
			icon.alpha = 1;
			icon.width = w;
			icon.height = h;
			
			width = w;
			height = h;
			
			addChild(icon);
			
			addEventListener(SnapDraggableObject.OBJECT_UP, onThumbUp);
			addEventListener(SnapDraggableObject.OBJECT_MOVE, onThumbMove);
		}
		private function onThumbUp(e:Event):void
		{
			dispatchEvent(new Event(THUMB_UP, true));
		}
		
		private function onThumbMove(e:Event):void
		{
			dispatchEvent(new Event(THUMB_MOVE, true));
		}
		
	}
}